Fix multiple reported issues#10965
Open
kareem-wolfssl wants to merge 5 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses multiple reported issues (zd#22133) by tightening memory-management around X509 decoding and improving safety in shared-context initialization and key allocation logic.
Changes:
- Prevent orphaned allocations when re-decoding certificates into existing
WOLFSSL_X509objects. - Add CTX-level locking around lazy
ctx->suitesinitialization to avoid races/leaks in multi-threadedwolfSSL_new()usage. - Zero newly allocated key structures in
AllocKey()to make partial-init failure paths safe to free.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/ssl.c | Frees existing X509 contents before reinitializing/decoding to avoid orphaned allocations. |
| src/internal.c | Guards lazy ctx->suites init with CTX mutex and zeroes AllocKey() allocations pre-init. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Contributor
Author
|
Retest this please |
Frauschi
reviewed
Jul 23, 2026
Frauschi
left a comment
Contributor
There was a problem hiding this comment.
🐺 Skoll Code Review
Overall recommendation: APPROVE
Findings: 3 total — 1 posted, 2 skipped
Posted findings
- [Medium] suites race fix not applied to the parallel lazy-alloc path in wolfSSL_set_SSL_CTX —
src/internal.c:8274-8299
Skipped findings
- [Medium] No regression test added for the concurrent suites-init and peerCert re-decode fixes
- [Low] Redundant FreeX509/InitX509 in wolfSSL_get_peer_certificate now that DecodeToX509 frees internally
Review generated by Skoll via Claude/Codex
…olfSSL_get_peer_certificate.
…on failure and free.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes zd#22133
Testing
Built in tests, provided reproducers
Checklist